/*
** supp_list.c for 42sh in /home/demesy_j/svn/quarante-deuxsh/trunk
**
** Made by julien demesy
** Login   <demesy_j@epitech.net>
**
** Started on  Mon Mar 12 11:17:26 2012 julien demesy
** Last update Mon Mar 12 13:47:59 2012 william muller
*/

#include	<stdlib.h>
#include	"list.h"

void		delete_elem(t_list *element)
{
  element->prev->next = element->next;
  element->next->prev = element->prev;
  free(element);
}

void		delete_first(t_list *root)
{
  if (root->next != root)
    delete_elem(root->next);
}

void		delete_last(t_list *root)
{
  if (root->prev != root)
    delete_elem(root->prev);
}
